Imports System.Windows.forms
Imports System.Collections.Generic
Imports System.Reflection


Public Class FormTags

    Private Sub FormTags_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated

        txtTags.Focus()

    End Sub

    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        Try

            Me.DialogResult = Windows.Forms.DialogResult.OK

        Catch ex As Exception

        End Try


    End Sub


    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click

        Me.DialogResult = Windows.Forms.DialogResult.Cancel

    End Sub

    Private Sub FormTags_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            If My.Computer.FileSystem.FileExists(My.Computer.FileSystem.CurrentDirectory & "\Plugins\TagTemplates.xml") = False Then
                Dim myCreate As CreateXmlFile = New CreateXmlFile
                myCreate.CreateXMLFile()
            End If

        Catch ex As Exception

            Dim mylog As New LogFile
            mylog.WriteToLog(ex.Message.ToString & " " & ex.InnerException.ToString)

        End Try

    End Sub

    Function GetProgramVersion() As String
        Dim stMajor As String = ""
        Dim stMinor As String = ""
        Dim stRevision As String = ""
        Dim stBuild As String = ""
        Dim stVersion As String = ""

        stMajor = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Major.ToString
        stMinor = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Minor.ToString
        stRevision = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Revision.ToString
        stBuild = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Build.ToString
        stVersion = "v" & stMajor & "." & stMinor & "." & stRevision & " Build " & stBuild

        Return stVersion

    End Function

    Public ReadOnly Property AssemblyTitle() As String
        Get
            ' Get all Title attributes on this assembly
            Dim attributes() As Object = Assembly.GetExecutingAssembly.GetCustomAttributes(GetType(AssemblyTitleAttribute), False)
            ' If there is at least one Title attribute
            If (attributes.Length > 0) Then
                ' Select the first one
                Dim titleAttribute As AssemblyTitleAttribute = CType(attributes(0), AssemblyTitleAttribute)
                ' If it is not an empty string, return it
                If (titleAttribute.Title <> "") Then
                    Return titleAttribute.Title
                End If
            End If
            ' If there was no Title attribute, or if the Title attribute was the empty string, return the .exe name
            Return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly.CodeBase)
        End Get
    End Property


End Class